package edu.hawaii.wicket.page.login;

import org.apache.wicket.ResourceReference;
import org.apache.wicket.markup.html.CSSPackageResource;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.image.Image;
import org.apache.wicket.markup.html.link.Link;
import edu.hawaii.wicket.page.home.HomePage;
import edu.hawaii.wicket.page.style.IEStylesheetHeaderContributor;
import org.apache.wicket.model.Model; 
/**
 * The application home page.  This page illustrates links. 
 * @author Philip Johnson
 */
public class LoginPage extends WebPage {
  private static final ResourceReference LOGIN = new ResourceReference(LoginPage.class,
  "login-button.png");
  /** Support serialization. */
  private static final long serialVersionUID = 1L;
  
  /**
   * The home page for this application.  In this example, all of the material for the home
   * page is provided in the BasePage class, the BasePage.html file, and the HomePage.html file.
   * 
   */
  public LoginPage() {
    add(CSSPackageResource.getHeaderContribution(
            edu.hawaii.wicket.page.login.LoginPage.class, "screen.css", "screen"));
    add(CSSPackageResource.getHeaderContribution(
        edu.hawaii.wicket.page.login.LoginPage.class, "print.css", "print"));
    add(new IEStylesheetHeaderContributor(
        new ResourceReference(edu.hawaii.wicket.page.login.LoginPage.class, "ie.css")));
    add(new Label("title", "Login"));
    

    add(new Image("login", new Model<ResourceReference>(LOGIN)));
    
    add(new Link<String>("HomePageLink") {
        private static final long serialVersionUID = 1L;
        /** Upon clicking this link, go to FormPage. */
        @Override
        public void onClick() {
          setResponsePage(new HomePage());
        }
        }
      );
/*    add(new ImageButton("login") {
        private static final long serialVersionUID = 1L;

        @Override
        public void onSubmit() {
          setResponsePage(new HomePage());
        }
      }
      );
*/ 
    }
}
